battleData = {}
battleData.__index = battleData

function battleData.create(hexSize)
	local data = {}
	setmetatable(data,battleData)
	
	data.hexSize = hexSize
	data.players = {}
	data.enemies = {}
	
	return data
end

function battleData:AddPlayer(index, player, startAnim, x, y, offsetY)
	self.players[index] = battlePlayer.create(player.name, player.sprite, player.width, player.height, player.offsetX, player.offsetZ, player.hp, player.attack, player.shield)
	self.players[index].name = self.players[index].name .. index
	battleUI.PlaceNPC(self.players[index].name, self.players[index].sprite, self.players[index].width, self.players[index].height, x, y, offsetY, self.players[index].offsetX, self.players[index].offsetZ)
	AnimateNPC(self.players[index].name, startAnim)
end

------------------------------------------------------------

battlePlayer = {}
battlePlayer.__index = battlePlayer

function battlePlayer.create(name, sprite, width, height, offsetX, offsetZ, hp, attack, shield)
	local player = {}
	setmetatable(player,battlePlayer)
	
	player.name = name
	player.sprite = sprite
	player.width = width
	player.height = height
	player.offsetX = offsetX
	player.offsetZ = offsetZ
	player.HP = hp
	player.attack = attack
	player.shield = shield
	
	return player
end

function battlePlayer:JumpTo(x, y, offsetY)
	battleUI.MoveNPC(self.name, x, y, offsetY, self.offsetX, self.offsetZ)
end

function battlePlayer:MoveTo(x, y, offsetY, duration)
	battleUI.LerpMoveNPC(self.name, x, y, offsetY, GetCurrentTime(), GetCurrentTime() + duration, self.offsetX, self.offsetZ)
end

------------------------------------------------------------

battleEnemy = {}
battleEnemy.__index = battleEnemy

function battleEnemy.create(name, sprite, width, height, offsetX, offsetZ, hp, attack, shield)
	local enemy = {}
	setmetatable(enemy,battleEnemy)
	
	enemy.name = name
	enemy.sprite = sprite
	enemy.width = width
	enemy.height = height
	enemy.offsetX = offsetX
	enemy.offsetZ = offsetZ
	enemy.HP = hp
	enemy.attack = attack
	enemy.shield = shield
	
	return enemy
end

function battleEnemy:JumpTo(x, y, offsetY)
	battleUI.MoveNPC(self.name, x, y, offsetY, self.offsetX, self.offsetZ)
end

function battleEnemy:MoveTo(x, y, offsetY, duration)
	battleUI.LerpMoveNPC(self.name, x, y, offsetY, GetCurrentTime(), GetCurrentTime() + duration, self.offsetX, self.offsetZ)
end